//logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    // logs: []
  },
  onLoad: function () {
    // this.setData({
    //   logs: (wx.getStorageSync('logs') || []).map(log => {
    //     return util.formatTime(new Date(log))
    //   })
    // })
  },
  tabbarEvent(e){
    let num = parseInt(e.target.dataset.num);
    switch(num){
      case 1: wx.showTabBar(); break;
      case 2: wx.hideTabBar(); break;
      case 3: wx.setTabBarBadge({
        index: 0,
        text: '99+',
      }); break;
      case 4: wx.removeTabBarBadge({
        index: 0,
      }); break;
      case 5: wx.showTabBarRedDot({
        index: 1,
      }); break;
      case 6: wx.hideTabBarRedDot({
        index:1
      }); break;
      case 7:
        // 动态设置 tabBar 某一项的内容
        wx.setTabBarItem({
          index: 1,
          text:'文档'
        })
       break;
       case 8:
      //  动态改变tabbar的整体样式
       wx.setTabBarStyle({
         color:'#00ff88'
       })
       break;
    }
  }
})
